package com.lezhi.socialgram.model.friend;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.lezhi.socialgram.annotation.Table;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * Created by daizhen on 2017/4/5.
 */
@Table(prefix = "t_my_like_")
public class MyLike {

    private String table;

    @NotNull(message = "自己的id不能为null")
    private Long uid;

    @NotNull(message = "对方的id不能为null")
    private Long fid;

    @NotNull(message = "是否喜欢不能为null")
    private Integer isLike;

    private Integer operation;

    private Date createTime;

    private Date updateTime;

    public MyLike() {
    }

    public MyLike(String table, Long uid) {
        this.table = table;
        this.uid = uid;
    }

    @JsonIgnore
    public String getTable() {
        return table;
    }

    public void setTable(String table) {
        this.table = table;
    }

    public Long getUid() {
        return uid;
    }

    public void setUid(Long uid) {
        this.uid = uid;
    }

    public Long getFid() {
        return fid;
    }

    public void setFid(Long fid) {
        this.fid = fid;
    }

    public Integer getIsLike() {
        return isLike;
    }

    public void setIsLike(Integer isLike) {
        this.isLike = isLike;
    }

    public Integer getOperation() {
        return operation;
    }

    public void setOperation(Integer operation) {
        this.operation = operation;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @JsonIgnore
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "MyLike{" +
                "uid=" + uid +
                ", fid=" + fid +
                ", isLike=" + isLike +
                '}';
    }
}
